home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / misc / spctr3e2 / spice3.doc < prev   
Text File  |  1992-12-11  |  38KB  |  877 lines

  1.  
  2. An abridged spice3 manual, it might even be useful.  This manual
  3. covers basic spice syntax and commands for using Spice TR3e2 in both
  4. interactive and batch modes.  It may not be complete, but a more
  5. complete version is being worked on.
  6.  
  7. SPICE (simulation program with integrated circuit emphasis) was
  8. developed in the Electronics Research Laboratory at the University of
  9. California at Berkeley.  Spice3 is based on spice2.  When used in batch
  10. mode, most of the syntax and commands are the same, but there are
  11. changes.  For example, the output can be similar, using the -o option,
  12. or the may be written in a "RAW" file format (the raw file format must
  13. be used if it is to be plotted with Spice TR3e2's graphics capability).
  14. Polynomial non-linear sources are replaced by a General non-linear
  15. source (NOTE: most opamp libraries are made for spice2g6 and use
  16. polynomial non-linear sources-> exception:  most of Linear Technology
  17. Corporation's models will work with either spice2 or spice3).
  18. Polynomial nonlinear capacitors are not supported in Spice3.
  19.  
  20. *************** input format ****************************
  21.  
  22. A circuit to be analyzed by Spice is described by a netlist which
  23. defines the circuit topology, element (or part) values, and may
  24. include the type of analysis to be run.
  25.  
  26. Spice uses ASCII input files.  The input format for Spice is of the
  27. free format type.  Fields on a line are separated by one or more
  28. blanks, a comma, an equal (=) sign, or a left or right parenthesis;
  29. extra spaces are ignored.  A line may be continued by entering a "+" in
  30. column one of the following line.  Comments can be included in the
  31. listing-just place a "*" in column one of the line (a space will also
  32. work for Spice3).
  33.  
  34. The first line in a Spice input file is assumed to be the circuit
  35. title.  The last line must be the ".END" line.  Between are the parts,
  36. type of analysis, and any subcircuits or models.  The order of these
  37. statements is arbitrary (except [of course], that continuation lines
  38. must immediately  follow  the  line  being continued, and element lines
  39. belonging to a subcircuit must be between the  ".SUBCKT" and ".ENDS"
  40. lines for that subcircuit).  Other files may be added by using the
  41. ".include file_name" command.
  42.  
  43. Spice is not case-sensitive most of the time (the ".include" command
  44. must be lower case).
  45.  
  46. In Spice2, nodes must be labeled as number, in Spice3 they may be may
  47. be arbitrary character strings, except for the ground node which must
  48. be named "0".  All nodes must have a dc path to ground. The circuit
  49. cannot contain a loop of voltage sources and/or inductors and cannot
  50. contain a series connection of current sources and/or capacitors.
  51. Every node must have at least two connections, except for transmission
  52. line nodes (to permit unterminated transmission lines) and MOSFET
  53. substrate nodes (which have two internal connections anyway).
  54.  
  55. Numbers may be interred directly, followed by a integer exponent, or a
  56. scale factor.  6000, 6e3, and 6k all have the same value. The scale
  57. used are:  T=e12  G=e9   Meg=e6   K=e3    mil=25.4e-6
  58.            m=e-3  u=e-6  n=e-9    p=e-12  f=e-15
  59. Letters immediately following a number that are not scale factors are
  60. ignored, and letters immediately following a scale factor are ignored.
  61. Hence, 10, 10V, 10VOLTS, and 10hz all represent the same number, and M,
  62. MA, MSEC, and MMHOS all represent the same scale factor.
  63.  
  64. Each element in the circuit is specified by an element line that
  65. contains the element name, the circuit nodes to which the element is
  66. connected, and the values of the parameters that determine the
  67. electrical characteristics of the element.  The first letter of the
  68. element name specifies the element type.  The  format  for the SPICE
  69. element types is given in what follows.  The strings  XXXXX, YYYYY, and
  70. ZZZZZ denote arbitrary alphanumeric strings.  For example, a resistor
  71. name must begin with the letter `R' and can  contain one or more
  72. characters.  Hence, R, R1, RSE, ROUT, and R3AC2ZY are valid resistor
  73. names.
  74.  
  75.  
  76.  
  77.  
  78. ******* Command line Usage ************
  79.  
  80. spice [ -n ] [ -b ] [ -o outfile ] [ -r rawfile ] [ input_file ]
  81.  
  82.      -n (or -N)
  83.           Don't try to source the file "spice.rc" upon startup.
  84.           Normally Spice tries to find this file in the current
  85.           directory.
  86.  
  87.      -b (or -B)
  88.           Run in batch mode. Spice will read the specified input
  89.           file and do the simulation.
  90.  
  91.      -r rawfile (or -R rawfile)
  92.           Use rawfile as the default file into which the results of
  93.           the simulation are saved.  If the -r option is used, the
  94.           .print and .plot commands will be ignored.
  95.  
  96.      -o outfile (or -O outfile)
  97.           Print analysis time and memory usage to a file, and if the
  98.           -r option is not used, use the .print and .plot commands to
  99.           make a Spice2 type output file.
  100.  
  101. Further arguments are taken to be Spice input files, which are read and
  102. saved. (If batch mode is requested then they are run immediately.)
  103.  
  104. Spice files specified on the command line are read in before the
  105. "spice.rc" file is read.  Thus if you define aliases there, any that
  106. are used in a Spice source file mentioned on the command line won't be
  107. recognized.
  108.  
  109.  
  110.  
  111. **************** Parts ******************************
  112. Data fields that are enclosed in less than and greater than signs ("<"
  113. or ">") are optional.
  114.  
  115. resistor
  116.      Format: Rname Node1 Node2 value
  117.      Examples: R1 32 45 1k
  118.                rload 8 0 200
  119.  
  120.          The name must start with the letter R.  The value may be
  121.          positive or negative, but not zero.
  122.  
  123. capacitor
  124.     Format: Cname Node1 Node2 value
  125.     Examples: C1 32 45 1uf
  126.               cload 8 0 200pf
  127.  
  128.          The name must start with the letter C.
  129.  
  130. inductor
  131.     Format: Lname +Node -Node value
  132.     Examples: L1 32 45 1uh
  133.               lload 8 0 200uh
  134.  
  135.          The name must start with the letter L.
  136.  
  137. mutual inductor
  138.     Format: Kname Lname1 Lname2 value
  139.     Example: k1 L5 L9 .987
  140.  
  141.          The name must start with the letter K.  Two inductors are
  142.          referenced.  The standard dot convention determines polarity-
  143.          with the positive node on the inductors having the dot.  Value
  144.          is the coefficient of coupling, which must be between 0 and 1.
  145.  
  146. Lossless Transmission Lines
  147.  
  148.      Format: Tname N1 N2 N3 N4 Z0=value TD=value
  149.              Tname N1 N2 N3 N4 Z0=value F=freq NL=nrmlen
  150.  
  151.     Example: t1 1 0 2 0 z0=75 td=15ns
  152.  
  153.          The name must start with the letter T. N1 and N2 are the nodes
  154.          at port one; N3 and N4 are the nodes at port two.  Z0 is the 
  155.          characteristic impedance.  The length of the line must be 
  156.          expressed in either one of two forms : the delay may be specified
  157.          directly (TD=value) or a frequency (F=freq) must be given.  If 
  158.          the frequency is given, the normalized electrical length 
  159.          (NL=value) may be given (the default is NL=.25).            
  160.  
  161.          NOTE1: This models only one propagating mode.  If all four nodes 
  162.                 are distinct in the actual circuit, then two modes may be 
  163.                 excited.  To simulate this, two transmission line elements
  164.                 are required. 
  165.  
  166.          NOTE2: The lossy transmission line with zero loss may be more 
  167.                 accurate due to implementation details.
  168.  
  169. sources
  170.   independent source
  171.     Format: _name +node -node [dc value] [ac value] [tran_value]
  172.     Examples: Vcc 10 0   15
  173.               Icc 2 5   1ma
  174.               vin 1 0 dc 0 ac 1 pulse(-0.5 0.5 20us 20us 20us 200us 400us)
  175.  
  176.       If the name starts with a V it is a voltage source and if it
  177.       starts with an I it is a current source.  The transient value
  178.       may have the following values:
  179.        PULSE(v1 v2 pulse_delay [rise_time fall_time pulse_width period])
  180.        SIN(offset_voltage amplitude frequency [start_delay damping_coef])
  181.        PWL(time_point1 volt_or_amp1 [t2 v_or_a2 ...])
  182.  
  183.   linear dependent sources
  184.     Format: _name +nodeOut -nodeOUT +nodeIN -nodeIN value
  185.     Examples: G1 10 0 5 0  15mmho
  186.               E1  2 0 5 0  1e8
  187.  
  188.         If the name starts with a G, it is a voltage controlled
  189.         current source.  If the name starts with a E, it is a voltage
  190.         controlled voltage source.
  191.  
  192.     Format: _name +nodeOut -nodeOUT vname value
  193.     Examples: F1 1 2 vz 26
  194.               H3 5 7 vy 345
  195.  
  196.          Vname is the name of a voltage source through which the
  197.          controlling current flows.  If the name starts with a F, it is
  198.          a current controlled current source.  If the name starts with
  199.          a H, it is a current controlled voltage source.
  200.  
  201.   non-linear dependent sources (these sources are not spice2 compatible)
  202.     Format: Bname +nodeOut -nodeOUT <I=expr> <V=expr>
  203.     Examples: b1 1 0 i=cos(v(1))+sin(v(2))
  204.               b2 5 3 v=log(v1))^2
  205.  
  206.          The name must start with the letter B.  The values of the V
  207.      and I parameters determine the voltages and currents across
  208.      and through the device, respectively.  Only one of these
  209.          parameters must be given.  The expressions given for V and I
  210.          may be any function of voltages and currents through voltage
  211.          sources in the system.  The following functions of real
  212.          variables are defined:  abs     asinh     cosh    sin
  213.                                  acos    atan      exp     sinh
  214.                                  acosh   atanh     ln      sqrt
  215.                                  asin    cos       log     tan
  216.  
  217.          The following operations are defined:
  218.               +   -   *   /   ^   unary
  219.  
  220.          If the argument of log, ln or sqrt becomes less than zero, the
  221.          absolute value of the argument is used.  If a divisor becomes
  222.          zero, an error will result.  Other problems may arise where
  223.          the partial derivative of a function is undefined.
  224.  
  225. Parts that need MODELS:
  226.  
  227.  Some devices (or parts) that spice simulates require many parameter
  228.  values.  Since these devices may be used more than once in a circuit
  229.  (with the same set of parameters), they have a set of "model"
  230.  parameters that is defined on a separate model line with the format:
  231.    .MODEL model_name type(parameters)
  232.  Examples:
  233.    .model mod1 npn (BF=50 IS=1e-13 VBF=50)
  234.    .model dm1 d (is=2e-17)
  235.  Among the model types used in Spice TR3e2bl are npn, pnp, d, njf, pjf,
  236.  ltra and sw.
  237.  
  238.  NOTE: Although the model line is required for these parts, spice will
  239.        use the default values for the unspecified parameter values.
  240.        Please see some "real" spice documentation for the semiconductor 
  241.        default values.
  242.  
  243. diodes (D)
  244.     Format: Dname NodeA NodeC modname
  245.     Example: d1 32 45 d1n4841
  246.  
  247.          The name must start with the letter D.  NodeA is the anode and
  248.          NodeC is the cathode.
  249.  
  250. bipolar junction transistors (NPN, PNP)
  251.     Format: Qname collector base emitter modname
  252.     Examples: Q1 32 45  40 Q2N2222A
  253.               q27 1 2 3 q2n2222a
  254.  
  255.          The name must start with the letter Q.
  256.  
  257. junction FETs (NJF, PJF)
  258.     Format: Jname drain gate source modname
  259.     Example: J1 32 45  40 JN2
  260.  
  261.          The name must start with the letter J.
  262.  
  263. Lossy Transmission Lines (LTRA)
  264.     
  265.     Format: Oname N1 N2 N3 N4 modname
  266.     Example: o1 1 0 2 0  tran1
  267.  
  268.          The name must start with the letter O. N1 and N2 are the nodes 
  269.          at port one; N3 and N4 are the nodes at port two.  Note: a 
  270.          lossy transmission line with zero loss may be more accurate 
  271.          than a lossless transmission line due to implementation details.
  272.  
  273.          MODEL    parameters
  274.          R             resistance/length (default 0.0)
  275.          L             inductance/length (default 0.0)
  276.          G             conductance/length (default 0.0)
  277.          C             capacitance/length (default 0.0)
  278.          LEN           length of line required -> no default
  279.          REL           breakpoint control (default 1)
  280.          ABS           breakpoint control (default 1)
  281.          NOSTEPLIMIT   do not limit timestep to less than time delay (flag)
  282.          NOCONTROL     don't do complex timestep control (flag)
  283.          LININTERP     use linear interpolation (flag)
  284.          MIXEDINTERP   use linear when quadratic seems bad (flag)
  285.          COMPACTREL    special reltol for history compaction
  286.          COMPACTABS    special abstol for history compaction
  287.          TRUNCNR       use Newton-Raphson method for timestep control (flag)
  288.          TRUNCDONTCUT  don't limit timestep to keep impulse-response errors 
  289.                        low (flag)
  290.  
  291.     Only the following types of lines have been implemented so far:
  292.         RLC -  uniform transmission line with series loss only
  293.         RC  -  uniform RC line
  294.         LC  -  lossless transmission line
  295.         RG  -  distributed series resistance and parallel conductance
  296.     Any other combination will yield erroneous results and should not be tried.
  297.  
  298. Switches (SW)
  299.     Format: Sname N+ N- NC+ NC- modname <on><off>
  300.     Example: s1 2 5 3 0 sw1
  301.  
  302.          The name must start with the letter S (for a voltage
  303.      controlled switch).  Switches must always have a finite
  304.      positive value.  It is wise to set switch impedances only high
  305.      and low enough to be negligible with respect to other circuit
  306.      elements.  Switches will not change state in AC analyses.
  307.  
  308.      MODEL    parameters
  309.        VT     threshold voltage (default 0.0v)
  310.        VH     hysteresis (default 0.0v)
  311.        RON    on resistance (default 1 ohm)
  312.        ROFF   off resistance (default 1/GMIN ohm)
  313.  
  314.  
  315.  
  316. ******************** Subcircuits **********************
  317.  
  318. A subcircuit consists of spice elements and can be referenced in a
  319. fashion similar to device models.  Spice will automatically insert the
  320. group of elements wherever the subcircuit is referenced.
  321.  
  322.   Format for subcircuit reference: xname node1 node2 <node...> subname
  323.  
  324.          The name must start with the letter X.
  325.  
  326.   Format for subcircuit: .subckt subname sub_node1 <sub_node...>
  327.                          parts sub_nodes...
  328.              .ends
  329.  
  330.          The subcircuit must end with the line: ".ends <subname>"
  331.      Ground (the 0 node) may be used in a subcircuit but can not
  332.      be listed as an external node.  Node references in a subcircuit
  333.      are independent of (not the same node as) any node which may have
  334.      the same name in either the main circuit or another
  335.      subcircuit.
  336.  
  337. **  example of a subcircuit **
  338. .subckt pienet 2 3
  339. c1 2 0 100p
  340. l1 2 3 10u
  341. c2 3 0 100p
  342. .ends pienet
  343. ** end of example **
  344.  
  345.  
  346.  
  347. *************** Spice file commands *********************
  348.  
  349. These commands are placed in the input files for use in the batch mode,
  350. or with the interactive "run" command.
  351.  
  352. dc operating point
  353.  
  354.     Format: .op
  355.         This command directs spice3 to include the dc operating
  356.     information in the RAW output file.
  357.  
  358. DC analysis
  359.  
  360.     Format: .dc source_name vstart vstop vincrement
  361.  
  362. AC analysis
  363.  
  364.     Format: .ac dec nd fstart fstop
  365.         dec is for the decade variation, oct or lin can be used instead
  366.     for the octave or linear variation.  nd is the number of points
  367.     per decade, octave or absolute, depending on option chosen.
  368.     At least one independent source must have been specified with
  369.     an ac value for the analysis to be meaningful.
  370.     NOTE: AC analysis is a linear small-signal analysis.  No clipping
  371.         of signals will take place.
  372.  
  373. Transient analysis
  374.  
  375.     Format: .tran tstep tstop <tstart <tmax>>
  376.         Transient analysis always start at time zero, if tstart is
  377.         non-zero, the data between zero and tstart is not saved.
  378.  
  379.  
  380. ***************** other file commands **********************
  381.  
  382. These commands are placed in the input files, all are used in the batch
  383. mode, some will not do anything in the interactive mode.  Try it.  If
  384. it works, it works.
  385.  
  386. .NODESET  V(node_number)=value V(node_number)=value ...
  387.    This line may help spice find the DC or initial transient solution
  388.    by making a preliminary pass with the specified nodes held to the
  389.    given voltages.  The restriction is then released and the iteration
  390.    continues to the true solution.  The .NODESET line may be necessary
  391.    for convergence on bistable or astable circuits, but it should not
  392.    otherwise be needed.
  393.  
  394. .IC V(node_number)=value V(node_number)=value ...
  395.    This line is for setting transient initial conditions.  It has two
  396.    different interpretations, depending on whether the UIC parameter
  397.    is specified on the .TRAN line.  The .IC line should not be confused
  398.    with the .NODESET line -> the .NODESET line does not affect final
  399.    bias solution (except for multi-stable circuits).
  400.        If the UIC parameter is not specified on the .TRAN control line,
  401.    the DC bias (initial transient) solution is computed before the
  402.    transient analysis.  In this case, the node voltages specified on
  403.    the .IC control line is forced to the desired initial values during
  404.    the bias solution.  During transient analysis, the constraint on
  405.    these node voltages is removed.  This is the preferred method since
  406.    it allows spice to compute a consistent DC solution.
  407.        If the UIC parameter is specified on the .TRAN control line, the
  408.    node voltages specified on the .IC control line are used to compute
  409.    the capacitor, diode, BJT JFET, and MOSFET initial conditions.  This
  410.    is equivalent to specifying the IC=... parameter on each device
  411.    line, but is more convenient.  The IC=... parameter can still be
  412.    specified and takes precedence over the .IC values.  Since no DC
  413.    bias (initial transient) solution is computed before the transient
  414.    analysis, one should take care to specify all dc source voltages on
  415.    the .IC control line if they are to be used to compute device
  416.    initial conditions.
  417.  
  418. .OPTIONS  option1=value option2=value ...
  419.    This line allows the user to reset program control and user options
  420.    for specific simulation purposes.  Any combination of the following
  421.    options may be included, in any order.  Below, 'x' represents some
  422.    positive number.
  423.  
  424.      option        effect
  425.  
  426.      GMIN=x        the minimum conductance allowed (default 1.0e-12)
  427.      RELTOL=x      the relative error tolerance (default .001 -> 0.1
  428.                        percent)
  429.      ABSTOL=x      the absolute current error tolerance (default 1
  430.                        picoamp)
  431.      VNTOL=x       the absolute voltage error tolerance
  432.                        (default 1 microvolt)
  433.      CHGTOL=x      the charge tolerance (default 1.0e-14)
  434.      TRTOL=x       the transient error tolerance (default 7)  This
  435.                        parameter is an estimate of the factor by which
  436.                        spice overestimates the actual truncation error.
  437.      PIVTOL=x      the absolute minimum value for a matrix entry to be
  438.                        accepted as a pivot (default 1.0e-13)
  439.      PIVREL=x      the relative ratio between the largest column entry
  440.                        and an acceptable pivot value (default 1.0e-3)
  441.      TNOM=x        the nominal temperature at which device parameters
  442.                are measured (default 27 deg C)
  443.      TEMP=x        the operating temperature of the circuit (default
  444.                        27 deg C)
  445.      ITL1=x        the DC iteration limit (default 100)
  446.      ITL2=x        the DC transfer curve iteration limit (default 50)
  447.      ITL3 and ITL5 are not implemented in spice3
  448.      ITL4=x        the transient analysis timepoint iteration limit
  449.                        (default 10)
  450.      METHOD=name   sets the numerical integration method used by spice.
  451.                possible names "Gear" or "trapezoidal" (or
  452.                "trap") (default trap)
  453.  
  454. .save [ node1 ] [ node2 ... ]
  455.    Save a set of outputs, discarding the rest.  Useful only in batch
  456.    mode when a raw file format is used. If a node has been mentioned in
  457.    a save command, it will appear in the raw file.  If there are no
  458.    save commands given, all outputs are saved.  The save command must
  459.    be given before an analysis command to have an affect.
  460.  
  461. .print analysis_type output_var1 <output_var2 ... output_var8>
  462. .plot analysis_type output_var1 <output_var2 ... output_var8>
  463.    These commands are ignored if a raw file is produced.
  464.     Examples:
  465.     .print ac vdb(1) db(out)
  466.     .print tran v(2) i(vin)
  467.     .plot tran out
  468.  
  469. .four fundamental_frequency [ value ... ]
  470.    This command is ignored if a raw file is produced.  Does a fourier
  471.    analysis of each of the given values, using the first 10 multiples
  472.    of the fundamental frequency.
  473.     Example:
  474.     .four 10k out
  475.  
  476. .include file_name
  477.     Examples:
  478.     .include d1n4148.mod
  479.     .include ltc\lm301a
  480.  
  481.  
  482. ***************** interactive commands ******************
  483.  
  484. This chapter describes the most important interactive commands
  485. available for use with Spice TR3e2.  It must be remembered that Spice
  486. 3e2 was written for the Unix operating system.  Not all of the
  487. "Berkeley" commands will work under DR(MS)-DOS.  Commands that did not
  488. work, or were considered not useful, are not listed.  Those who may
  489. disagree on my definition of "what is useful" are free to call Berkeley
  490. for the "real" documentation(??).
  491.  
  492. Analysis Commands:
  493.  
  494.     Note: While commands, in general, are not case sensitive in input
  495.           files, they ARE case sensitive in the interactive mode -> use
  496.           lower case.
  497.  
  498.      op   Do an operating point analysis.
  499.  
  500.      tran [ .tran card args ]
  501.           Do a transient analysis.
  502.  
  503.      ac [ .ac card args ]
  504.           Do an ac analysis.
  505.  
  506.      dc [ .dc card args ]
  507.           Do a dc transfer curve analysis.
  508.  
  509. Other Commands:
  510.  
  511.      alias [ word ] [ text ... ]
  512.           Causes word to be aliased to text.  History substitutions
  513.           may be used, as in C-shell aliases.
  514.  
  515.      cd [ directory ]
  516.           Change the current working directory to directory, or to
  517.           the user's home directory if none is given.
  518.  
  519.      destroy [ plot_name ] [ all ]
  520.           Throws away the data in the named plot.  This can be
  521.       necessary if a lot of large simulations are being done.
  522.       Spice should warn the user if the size of the memory usage
  523.           is approaching the maximum allowable size (within about 90%).
  524.       It is advisable to run the rusage command occasionally if
  525.       running out of space is a possibility, since Spice will crash
  526.       if it does runs out of memory. If the argument to destroy is
  527.       all, all plots except the constant plot will be thrown away
  528.       (it is not possible to destroy the constant plot).  If no
  529.       argument is given the current plot is destroyed.
  530.  
  531.      display [ vector_name ... ]
  532.           Prints a summary of currently defined vectors, or of the
  533.       names specified.  The vectors are sorted by name unless the
  534.       variable nosort is set.  The information given is the name of
  535.       the vector, the length, the type of the vector, and whether
  536.       it is real or complex data.  Additionally, one vector will be
  537.       labeled [scale]. When a command such as plot is given without
  538.       a vs argument, this scale is used for the X-axis. It is
  539.       always the first vector in a rawfile, or the first vector
  540.       defined in a new plot. If you undefine the scale (i.e, let
  541.       TIME = []), a random remaining vector will become the scale.
  542.  
  543.      edit [ file ]
  544.           If a filename is given, then edit that file and (when done)
  545.       load it (making the circuit the current one)- else edit the
  546.       current SPICE3 deck.  The default editor is "VI".  The "set
  547.       editor=XXX" command (in either spice or DOS) can be used to
  548.       select a different editor.
  549.  
  550.      fourier fundamental_frequency [ value ... ]
  551.           Does a fourier analysis of each of the given values, using
  552.       the first 10 multiples of the fundamental frequency (or the
  553.       first nfreqs, if that variable is set). The output is like
  554.       that of the .four  card. The values may be any valid
  555.       expression.  The values are interpolated onto a fixed-space
  556.       grid with the number of points given by the fourgridsize
  557.       variable, or 200 if it is not set.  The interpolation will be
  558.       of degree polydegree if that variable is set, or 1.  If
  559.       polydegree is 0, then no interpolation will be done.  This is
  560.       likely to give erroneous results if the time scale is not
  561.       monotonic, though.
  562.  
  563.      hardcopy file plotargs
  564.           Just like plot, except creates a file containing the plot.
  565.       The default file format is postscript.  Other available
  566.       formants are not useful under DOS.
  567.  
  568.      history [ number ]
  569.           Print out the history, or the last number commands typed at
  570.       the keyboard.  Historical substitution is possible, !!<CR>
  571.       will repeat the last command, !1<CR> will repeat the first
  572.       command given.
  573.  
  574.      linearize [ vec ... ]
  575.           Create a new plot with all of the vectors in the current
  576.       plot, or only those mentioned if arguments are given.  The
  577.       new vectors will be interpolated onto a linear time scale,
  578.       which is determined by the values of tstep, tstart, and tstop
  579.       in the currently active transient analysis.  The currently
  580.       loaded deck must include a transient analysis (a tran command
  581.       may be run interactively before the last reset, alternately),
  582.       and the current plot must be from this transient analysis.
  583.       This command is needed because SPICE3 doesn't output the
  584.       results from a transient analysis in the same manner that
  585.       SPICE2 did.
  586.  
  587.      listing [ logical ] [ physical ] [ deck ] [ expand ]
  588.           Print a listing of the current circuit. If the "logical"
  589.       argument is given, the listing is with all continuation lines
  590.       collapsed into one line, and if the "physical" argument is
  591.       given the lines are printed out as they were found in the
  592.       file. The default is logical. A deck listing is just like the
  593.       physical listing, except without the line numbers it
  594.       recreates the input file verbatim (except that it does not
  595.       preserve case).  If the word "expand" is present, the circuit
  596.       will be printed with all subcircuits expanded.
  597.  
  598.      load [ filename ] ...
  599.           Loads the raw data from the files named. The default
  600.           filename is rawspice, or the argument to the -r flag
  601.           if there was one.
  602.  
  603.      plot exprs [ samep ] [ ylimit ylo yhi ] [ xlimit xlo xhi ]
  604.         [ xindices xilo xihi ] [ xcompress comp ] [ xdelta xdel ]
  605.     [ ydelta ydel ] [ xlog ] [ ylog ] [ vs xname ] [ xlabel word ]
  606.     [ ylabel word ]
  607.           Plot the given exprs on the screen.  If samep is given, the
  608.       values of the other parameters (other than xname) from the
  609.       previous plot, or hardcopy command will be used unless
  610.       re-defined on the command line.  The xlimit and ylimit
  611.       arguments determine the high and low x- and y-limits of the
  612.       axes, respectively. The xindices arguments determine what
  613.       range of points are to be plotted - everything between the
  614.       xilo'th point and the xihi'th point is plotted.  The
  615.       xcompress argument specifies that only one out of every comp
  616.       points should be plotted. If an xdelta or a ydelta parameter
  617.       is present, it specifies the spacing between grid lines on
  618.       the X- and Y-axis.  These parameter names may be abbreviated
  619.       to xl, yl, xind, xcomp, xdel, and ydel respectively.  The
  620.       xname argument is an expression to use as the scale on the
  621.       x-axis. If xlog or ylog are present, the X or Y scale
  622.       respectively will be logarithmic.  The xlabel and ylabel
  623.       arguments cause the specified labels to be used for the X and
  624.       Y axes, respectively.
  625.  
  626.      print [ col ] [ line ] expr ...
  627.           Prints the vector described by the expression expr. If the
  628.       col argument is present, print the vectors named side by
  629.       side. If line is given, the vectors are printed horizontally.
  630.       col is the default, unless all the vectors named have a
  631.       length of one, in which case line is the default.  The
  632.       options width, length, and nobreak are effective for this
  633.       command. If the expression is all, all of the vectors
  634.       available are printed.  The scale vector (time, frequency)
  635.       will always be in the first column unless the variable
  636.       noprintscale is true.
  637.  
  638.      quit
  639.           Quit, return to DOS.
  640.  
  641.      rusage [ resource ... ]
  642.           Print resource usage statistics.  If any resources are given,
  643.       just print the usage of that resource.  Currently valid
  644.       resources are:
  645.  
  646.                      elapsed
  647.                        The amount of time elapsed since the last rusage
  648.                elapsed call.
  649.  
  650.                      space
  651.                        Data space used.
  652.  
  653.                      time
  654.                        CPU time used so far.
  655.  
  656.                      everything
  657.                      all
  658.                        All of the above, and more.
  659.  
  660.      resume
  661.           Resume a simulation after a stop (a control C will stop a
  662.       run).
  663.  
  664.      run [ rawfile ]
  665.           Run the simulation as specified in the input file. If a
  666.       rawfile is given, the data is written, it is also 
  667.       available interactively.
  668.  
  669.      save [ node1 ] [ node2 ... ]
  670.           Save a set of outputs, discarding the rest. If a node has
  671.       been mentioned in a save command, it will appear in the
  672.       working plot after a run has completed.  If there are no save
  673.       commands given, all outputs are saved.  The save command must
  674.       be given before an analysis command to have an affect.  To
  675.           save the branch current through voltage source, add
  676.           "source_name#branch" to the list of nodes.
  677.  
  678.      set [ variable ] [ variable = value ]
  679.           Set the variable to value, if it is present.  If no value is
  680.       given then the value is the boolean 'true'.  You can set a
  681.       variable to be any value (numeric or string).  If a variable
  682.       is set to a list of values that are enclosed in parentheses
  683.       (which must be separated from their values by white space),
  684.       the value of the variable is that list.
  685.  
  686.            Variables for Spice TR3e2:
  687.  
  688.              abstol  The absolute tolerance used by the diff command.
  689.  
  690.              appendwrite
  691.                      Append to the file when a write command is issued,
  692.              if one already exists.
  693.  
  694.              combplot
  695.                      Plot vectors by drawing a vertical line from each
  696.              point to the X-axis, as opposed to joining the
  697.              points.  Note that this option is subsumed in the
  698.              plottype option, below.
  699.  
  700.              editor  The editor to use for the edit command.
  701.  
  702.              fourgridsize
  703.                      How many points to use for interpolating into when
  704.              doing fourier analysis.
  705.  
  706.              gridsize
  707.                      If this variable is set to an integer, this number
  708.              will be used as the number of equally spaced
  709.              points to use for the Y-axis when plotting.
  710.              Otherwise the current scale will be used (which
  711.              may not have equally spaced points).  If the
  712.              current scale isn't strictly monotonic, then this
  713.              option will have no effect.
  714.  
  715.              height  The length of the page for print col.
  716.  
  717.              history
  718.                      The number of events to save in the history list.
  719.  
  720.              nfreqs  The number of frequencies to compute in the
  721.                  fourier command. (Defaults to 10.)
  722.  
  723.              noaskquit
  724.                      Do not check to make sure that there are no
  725.              circuits suspended and no plots unsaved.  Normally
  726.              SPICE3 will warn the user when he tries to quit if
  727.              this is the case.
  728.  
  729.              nobjthack
  730.                      Assume that BJT's have 4 nodes.
  731.  
  732.              nobreak
  733.                      Don't have print col break between pages.
  734.  
  735.              noclobber
  736.                      Don't overwrite existing files when doing IO
  737.                      redirection.
  738.  
  739.              nogrid  Don't plot a grid when graphing curves (but
  740.                      do label the axes).
  741.  
  742.              nomoremode
  743.                      If nomoremode is not set, whenever a large amount
  744.              of data is being printed to the screen (e.g, the
  745.              print or display commands), the output will be
  746.              stopped every screenful and will continue when a
  747.              carriage return is typed. If nomoremode is set
  748.              then data will scroll off the screen without
  749.              hesitation.
  750.  
  751.              noprintscale
  752.                      Don't print the scale in the leftmost column when
  753.              a print col command is given.
  754.  
  755.              nosort  Don't have display sort the variable names.
  756.  
  757.              numdgt
  758.                      The number of digits to print when printing tables
  759.              of data (fourier, print col).  The default
  760.              precision is 6 digits.  Approximately 16 decimal
  761.              digits are available, so numdgt should not be more
  762.              than 16.  If the number is negative, one fewer
  763.              digit is printed to ensure constant widths in
  764.              tables.
  765.  
  766.              polydegree
  767.                      The degree of the polynomial that the plot command
  768.              should fit to the data. If polydegree is N, then
  769.              nutmeg will fit a degree N polynomial to every set
  770.              of N points and draw 10 intermediate points in
  771.              between each end point.  If the points aren't
  772.              monotonic, then it will try rotating the curve and
  773.              reducing the degree until a fit is achieved.
  774.  
  775.              polysteps
  776.                      The number of points to interpolate between every
  777.              pair of points available when doing curve fitting.
  778.              The default is 10. (This should really be done
  779.              automatically.)
  780.  
  781.              prompt  The prompt, with the character `!' replaced by
  782.                      the current event number.
  783.  
  784.              rawfile
  785.                      The default name for rawfiles created.
  786.  
  787.              rawfileprec
  788.                      The number of digits to use in the ascii rawfile
  789.              format.  The default is 15.
  790.  
  791.              reltol  The relative tolerance used by the diff command.
  792.  
  793.              sourcepath
  794.                      A list of the directories to search when a source
  795.              command is given.  The default is the current
  796.              directory and the SPICE_PATH\scripts.
  797.  
  798.              units   If this is degrees, then all the trig functions
  799.                      will use degrees instead of radians.
  800.  
  801.              unixcom
  802.                      When this variable is set, Spice will try to
  803.                      "shell" any non-spice command.
  804.  
  805.              vntol   The absolute voltage tolerance used by the
  806.                      diff command.
  807.  
  808.              width   The width of the page for print col.
  809.  
  810.      setcirc [ circuit name ]
  811.           Change the current circuit. The current circuit is the one
  812.       that is used for the simulation commands below.  When a
  813.       circuit is loaded with the "source" command (see below) it
  814.       becomes the current circuit.
  815.  
  816.      setplot [ plotname ]
  817.           Set the current plot to the plot with the given name, or if
  818.       no name is given, prompt the user with a menu.  (Note that
  819.       the plots are named as they are loaded, with names like tran1
  820.       or op2. These names are shown by the setplot and display
  821.       commands and are used by diff, below.) If the "New plot" item
  822.       is selected, the current plot will become one with no vectors
  823.       defined.  Note that here the word "plot" refers to a group of
  824.       vectors that are the result of one SPICE run.  When more than
  825.       one file is loaded in, or more than one plot is present in
  826.       one file, they are keep separate and only the vectors in the
  827.       current plot can be plotted.
  828.  
  829.      shell [ args ... ]
  830.           Fork a shell, or execute the arguments as a command to DOS.
  831.       If the "set unixcom" command is used (as it is in the default
  832.       spice.rc file), Spice will try to "shell" any non-spice
  833.       command that it can not "source".
  834.  
  835.      show device
  836.           Show a device's parameters.
  837.  
  838.      source file
  839.           Read the Spice input file file.  Interactive Spice commands
  840.       may be included in the file, but they must be enclosed
  841.       between the lines ".control" and ".endc"  (the file
  842.       "spice.rc" which is read on startup does not need these two
  843.       lines).  These commands are executed immediately after the
  844.       circuit is loaded.  Spice3 command scripts, other than
  845.       spice.rc, must begin with a blank or title line.  Also, any
  846.       line beginning with the characters "*#" will be executed as a
  847.       command.
  848.  
  849.           The use of this command is some what unnecessary, since Spice
  850.           will try to "source" any non-spice command.
  851.  
  852.      unalias [ word ... ]
  853.           Removes any aliases present for the words.
  854.  
  855.      unset [ word ] ...
  856.           Unset the variables word.
  857.  
  858.      version [ version_id ]
  859.           displays the version of Spice that is running.  If there are
  860.       arguments, it checks to make sure that the arguments match
  861.       the current version of Spice.  This is mainly used as a
  862.       command line in rawfiles.
  863.  
  864.      where
  865.           Gives the name of the last node or device to cause
  866.       non-convergence (for transient and operating point analysis).
  867.       Note: only one node or device is printed- there may be more
  868.       than one problem.
  869.  
  870.      write [ file ] [ exprs ... ]
  871.           Writes the expr's to file. First vectors are grouped together
  872.       by plots, and written out as such.  Additionally, if the
  873.       scale for a vector isn't present, it is automatically written
  874.       out as well.  The default filename is rawspice.raw, or the
  875.       argument to the -r flag on the command line, if there was
  876.       one, and the default expression list is all.
  877.